<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <!-- <script src="./promise-base.js"></script> -->
  <script src="./promise-async.js"></script>
  <script>
    // const p = new PromiseBase((resolve, reject) => {
    //   resolve('success')
    // }).then(
    //   (data) => {console.log('1', data)},
    //   (err) => {console.log('2', err)}
    // )

    const p = new PromiseAsync((resolve, reject) => {
      setTimeout(() => {resolve('success')}, 1000)
      
    }).then(
      (data) => {console.log('1', data)},
      (err) => {console.log('2', err)}
    )
  </script>
</body>
</html>